home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEextrudeTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.9 KB  |  163 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //
  20. //    Creation Date:    May 29, 1997
  21. //    Author:            ajp
  22. //
  23. //    Procedure Name:
  24. //    AEextrudeTemplate
  25. //
  26. //    Description Name;
  27. //    Creates the attribute editor controls for the extrude node
  28. //
  29. //    Input Value:
  30. //    nodeName
  31. //
  32. //    Output Value:
  33. //    None
  34. //
  35.  
  36.  
  37. global proc extrudeTypeControls( string $nodeName )
  38. {
  39.     string $typeAttrName = $nodeName + ".extrudeType";
  40.     int    $typeValue = `getAttr $typeAttrName`;
  41.  
  42.     if ( $typeValue == 0 )
  43.     {
  44.         // distance extrude type
  45.         editorTemplate -dimControl $nodeName "useProfileNormal" false;
  46.         editorTemplate -dimControl $nodeName "fixedPath" true;
  47.         editorTemplate -dimControl $nodeName "length" false;
  48.         editorTemplate -dimControl $nodeName "degreeAlongLength" false;
  49.  
  50.          // for direction dimming
  51.         useProfileNormalControls( $nodeName );
  52.     }
  53.     else if ( $typeValue == 1 )
  54.     {
  55.         // flat extrude type
  56.         editorTemplate -dimControl $nodeName "useProfileNormal" true;
  57.         editorTemplate -dimControl $nodeName "fixedPath" false;
  58.         editorTemplate -dimControl $nodeName "direction" true;
  59.         editorTemplate -dimControl $nodeName "length" true;
  60.         editorTemplate -dimControl $nodeName "degreeAlongLength" true;
  61.     }
  62.     else
  63.     {
  64.         // tube extrude type
  65.         editorTemplate -dimControl $nodeName "useProfileNormal" false;
  66.         editorTemplate -dimControl $nodeName "fixedPath" false;
  67.         editorTemplate -dimControl $nodeName "direction" true;
  68.         editorTemplate -dimControl $nodeName "length" true;
  69.         editorTemplate -dimControl $nodeName "degreeAlongLength" true;
  70.  
  71.         // for direction dimming
  72.         useProfileNormalControls( $nodeName );
  73.     }
  74.  
  75.     // for pivot dimming
  76.     useComponentPivotControls( $nodeName );
  77. }
  78.  
  79. global proc useProfileNormalControls( string $nodeName )
  80. {
  81.     int    $useNormalValue = 1;
  82.  
  83.     string $needUseDir = $nodeName + ".extrudeType";
  84.     int $useDir = `getAttr $needUseDir`;
  85.  
  86.     if( 0 == $useDir ) {
  87.         string $useNormalAttrName = $nodeName + ".useProfileNormal";
  88.         $useNormalValue = `getAttr $useNormalAttrName`;
  89.     }
  90.  
  91.     if ( $useNormalValue == 0 )
  92.     {
  93.         // need to specify a direction
  94.         editorTemplate -dimControl $nodeName "direction" false;
  95.     }
  96.     else
  97.     {
  98.         // no need to specify a direction since using profile normal
  99.         editorTemplate -dimControl $nodeName "direction" true;
  100.     }
  101. }
  102.  
  103. global proc useComponentPivotControls( string $nodeName )
  104. {
  105.     string $usePivotAttrName = $nodeName + ".useComponentPivot";
  106.     int    $usePivotValue = `getAttr $usePivotAttrName`;
  107.  
  108.     if ( $usePivotValue == 1 )
  109.     {
  110.         // can't use specified pivot (uses start of path instead)
  111.         editorTemplate -dimControl $nodeName "pivot" false;
  112.     }
  113.     else
  114.     {
  115.         // can use specified pivot
  116.         editorTemplate -dimControl $nodeName "pivot" true;
  117.     }
  118. }
  119.  
  120. global proc AEextrudeTemplate( string $nodeName )
  121. {
  122.     int $advMod = `licenseCheck -m edit -typ model`;
  123.     editorTemplate -beginScrollLayout;
  124.  
  125.         editorTemplate -beginLayout "Extrude History" -collapse false;
  126.             editorTemplate -callCustom "AEinputNew \"Profile Curve\""
  127.                     "AEinputReplace \"Profile Curve\""
  128.                     "profile";
  129.             editorTemplate -callCustom "AEinputNew \"Path Curve\""
  130.                     "AEinputReplace \"Path Curve\""
  131.                     "path";
  132.  
  133.             editorTemplate -addControl "extrudeType" "extrudeTypeControls";
  134.             editorTemplate -beginNoOptimize;
  135.             editorTemplate -addControl "useComponentPivot" "useComponentPivotControls";
  136.             editorTemplate -addControl "useProfileNormal" "useProfileNormalControls";
  137.             editorTemplate -endNoOptimize;
  138.             editorTemplate -addControl "fixedPath";
  139.             editorTemplate -addControl "direction";
  140.             editorTemplate -addControl "length";
  141.             editorTemplate -addControl "pivot";
  142.  
  143.             if( $advMod ) {
  144.                 editorTemplate -addControl "rotation";
  145.                 editorTemplate -addControl "scale";
  146.             }
  147.             editorTemplate -addControl "degreeAlongLength";
  148.         editorTemplate -endLayout;
  149.  
  150.     // include/call base class/node attributes
  151.     AEabstractBaseCreateTemplate $nodeName;
  152.  
  153.     editorTemplate -addExtraControls;
  154.     editorTemplate -endScrollLayout;
  155.  
  156.     editorTemplate -suppress "profile";
  157.     editorTemplate -suppress "path";
  158.     if( ! $advMod ) {
  159.         editorTemplate -suppress "rotation";
  160.         editorTemplate -suppress "scale";
  161.     }
  162. }
  163.